import { Entity, model, property } from '@loopback/repository';

@model()
export class Article extends Entity {

  @property({
    type: 'number',
    id: true,
  })
  id: number;

  @property({
    type: 'string',
    required: true,
    default: "",
  })
  title: string;

  @property({
    type: 'string',
  })
  abstracts?: string;

  @property({
    type: 'string',
  })
  content?: string;

  @property({
    type: 'date',
    required: true,
  })
  created: string;

  @property({
    type: 'date',
    required: true,
  })
  updated: string;

  constructor(data?: Partial<Article>) {
    super(data);
  }
}
